 
package com.len.core.token;

import org.apache.shiro.authc.AuthenticationToken;

import lombok.Data;
import lombok.ToString;

/**
 * jwtToken值对象
 * @author karlwang
 * @Time：2018年7月20日 下午1:54:17
 * @version 1.0  
 * Function: TODO
 */
@Data
@ToString
public class JwtToken implements AuthenticationToken{

    private static final long serialVersionUID = 1L;

    private String username;         //用户的标识
    private String ipHost;        //用户的IP
    private String deviceInfo;    //设备信息
    private String jwt;           //json web token值

    public JwtToken(String ipHost, String deviceInfo, String jwt,String username) {
        this.ipHost = ipHost;
        this.deviceInfo = deviceInfo;
        this.jwt = jwt;
        this.username = username;
    }

    /* (non-Javadoc)
     * @see org.apache.shiro.authc.AuthenticationToken#getPrincipal()
     */
    @Override
    public Object getPrincipal() {
        // TODO Auto-generated method stub
        return this.username;
    }

    /* (non-Javadoc)
     * @see org.apache.shiro.authc.AuthenticationToken#getCredentials()
     */
    @Override
    public Object getCredentials() {
        // TODO Auto-generated method stub
        return this.jwt;
    }
 
  
}
